package com.demo.freemarker.controller;

import com.demo.freemarker.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Author: hps
 * @Description:
 * @Date: Created in 19:59 2018/7/1
 */
@Controller
public class HelloController {

    @Autowired
    private UserService userService;

    @GetMapping("/hello")
    public String hello(Model model) {
        model.addAttribute("userList", userService.getAll());
        model.addAttribute("username", "hps");
        return "hello";
    }
}
